import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text('第一个组件'),
        backgroundColor: Colors.red,
        centerTitle: true,
        leading: const Icon(Icons.menu),
        actions: const [
          Icon(Icons.search),
        ],
        foregroundColor: Colors.white,
      ),
      body: const Column(
        children: [
          Text('111'),
          Text('222'),
          Text('333'),

        ],
      ),
    ),
  ));
  runApp( const MyApp());
}
//无状态组件(封装静态结构)
//class 自定义组件名称 extends StatelessWidet{}
class MyApp extends StatelessWidget {

  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('第一个组件'),
          backgroundColor: Colors.black,
          centerTitle: true,
          leading: const Icon(Icons.menu),
          actions: const [
            Icon(Icons.search),
          ],
          foregroundColor: Colors.white,
        ),
        body:  const Column(
          children: [
            Text('111'),
            Text('222'),
            Text('333'),
  Text('比较结果:${identical(const[1],const[1])}'),//true


          ],
        ),
      ),
    );
  }
}